﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_HopDongMuaBan : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvKhachHang")]
        private ADVObjects _AdvKhachHang;
        [AccessedThroughProperty("AdvNhanVien")]
        private ADVObjects _AdvNhanVien;
        [AccessedThroughProperty("CboLienHe")]
        private ComboBox _CboLienHe;
        [AccessedThroughProperty("CboLoaiGia")]
        private ComboBox _CboLoaiGia;
        [AccessedThroughProperty("CboLoaiTien")]
        private ComboBox _CboLoaiTien;
        [AccessedThroughProperty("CmdAdd")]
        private ToolStripButton _CmdAdd;
        [AccessedThroughProperty("CmdAddRow")]
        private Button _CmdAddRow;
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdDelRow")]
        private Button _CmdDelRow;
        [AccessedThroughProperty("CmdDieuKhoanMacDinh")]
        private ToolStripButton _CmdDieuKhoanMacDinh;
        [AccessedThroughProperty("CmdEdit")]
        private ToolStripButton _CmdEdit;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdFind")]
        private ToolStripButton _CmdFind;
        [AccessedThroughProperty("CmdHelp")]
        private ToolStripButton _CmdHelp;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripButton _CmdPrint;
        [AccessedThroughProperty("CmdSave")]
        private ToolStripButton _CmdSave;
        [AccessedThroughProperty("cmdTimDonHang")]
        private Button _cmdTimDonHang;
        [AccessedThroughProperty("CmdUnsave")]
        private ToolStripButton _CmdUnsave;
        [AccessedThroughProperty("GroupBox1")]
        private GroupBox _GroupBox1;
        [AccessedThroughProperty("GroupBox2")]
        private GroupBox _GroupBox2;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label10")]
        private Label _Label10;
        [AccessedThroughProperty("Label11")]
        private Label _Label11;
        [AccessedThroughProperty("Label12")]
        private Label _Label12;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label14")]
        private Label _Label14;
        [AccessedThroughProperty("Label15")]
        private Label _Label15;
        [AccessedThroughProperty("Label16")]
        private Label _Label16;
        [AccessedThroughProperty("Label17")]
        private Label _Label17;
        [AccessedThroughProperty("Label18")]
        private Label _Label18;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label20")]
        private Label _Label20;
        [AccessedThroughProperty("Label21")]
        private Label _Label21;
        [AccessedThroughProperty("Label22")]
        private Label _Label22;
        [AccessedThroughProperty("Label23")]
        private Label _Label23;
        [AccessedThroughProperty("Label24")]
        private Label _Label24;
        [AccessedThroughProperty("Label25")]
        private Label _Label25;
        [AccessedThroughProperty("Label26")]
        private Label _Label26;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Label8")]
        private Label _Label8;
        [AccessedThroughProperty("Label9")]
        private Label _Label9;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("Panel4")]
        private Panel _Panel4;
        [AccessedThroughProperty("Panel5")]
        private Panel _Panel5;
        [AccessedThroughProperty("TabControl1")]
        private TabControl _TabControl1;
        [AccessedThroughProperty("TabDetails")]
        private TabControl _TabDetails;
        [AccessedThroughProperty("TabPage1")]
        private TabPage _TabPage1;
        [AccessedThroughProperty("TabPage2")]
        private TabPage _TabPage2;
        [AccessedThroughProperty("TabPage4")]
        private TabPage _TabPage4;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripButton1")]
        private ToolStripSeparator _ToolStripButton1;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("ToolStripSeparator3")]
        private ToolStripSeparator _ToolStripSeparator3;
        [AccessedThroughProperty("TxtChucVu")]
        private TextBox _TxtChucVu;
        [AccessedThroughProperty("TxtChucVuBan")]
        private TextBox _TxtChucVuBan;
        [AccessedThroughProperty("TxtCongTy")]
        private TextBox _TxtCongTy;
        [AccessedThroughProperty("TxtDiaChi")]
        private TextBox _TxtDiaChi;
        [AccessedThroughProperty("TxtDiaChiBan")]
        private TextBox _TxtDiaChiBan;
        [AccessedThroughProperty("TxtDienThoai")]
        private TextBox _TxtDienThoai;
        [AccessedThroughProperty("TxtDienThoaiBan")]
        private TextBox _TxtDienThoaiBan;
        [AccessedThroughProperty("TxtFax")]
        private TextBox _TxtFax;
        [AccessedThroughProperty("TxtFaxBan")]
        private TextBox _TxtFaxBan;
        [AccessedThroughProperty("TxtHanGiaoHang")]
        private DateTimePicker _TxtHanGiaoHang;
        [AccessedThroughProperty("TxtMaSoThue")]
        private TextBox _TxtMaSoThue;
        [AccessedThroughProperty("TxtMaSoThueBan")]
        private TextBox _TxtMaSoThueBan;
        [AccessedThroughProperty("TxtNgayChungTu")]
        private DateTimePicker _TxtNgayChungTu;
        [AccessedThroughProperty("TxtNgayDathang")]
        private DateTimePicker _TxtNgayDathang;
        [AccessedThroughProperty("TxtSoBaoGia")]
        private TextBox _TxtSoBaoGia;
        [AccessedThroughProperty("TxtSoChungTu")]
        private TextBox _TxtSoChungTu;
        [AccessedThroughProperty("TxtSoTien")]
        private C1NumericEdit _TxtSoTien;
        [AccessedThroughProperty("TxtTienThue")]
        private C1NumericEdit _TxtTienThue;
        [AccessedThroughProperty("TxtTongCong")]
        private C1NumericEdit _TxtTongCong;
        [AccessedThroughProperty("txtTyGia")]
        private C1NumericEdit _txtTyGia;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        [AccessedThroughProperty("VSListDieuKhoan")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSListDieuKhoan;
        private DataView cFrmData;
        private string cFrmFormat;
        public string cFrmKhoa;
        private string cFrmKhoaOld;
        private string cFrmTask;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private bool mEnabledControl;
        private string mLoaiChungTu;
        private clsDonDatHang objDH;
        private clsDonDatHangChiTiet objDHCT;
        private clsChiTietDieuKhoanChungTu objDKCT;
        private clsHopDongMuaBan objHDMB;
        private clsHopDongMuaBanChiTiet objHDMBCT;
        private clsSoChungTu objSoCT;

        public Frm_HopDongMuaBan()
        {
            base.KeyDown += new KeyEventHandler(this.Frm_BaoGia_KeyDown);
            base.Load += new EventHandler(this.Frm_BaoGia_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.mLoaiChungTu = "HDMB";
            this.objSoCT = new clsSoChungTu();
            this.cFrmKhoa = "";
            this.cFrmKhoaOld = "";
            this.cFrmTask = "";
            this.objDH = new clsDonDatHang();
            this.objDHCT = new clsDonDatHangChiTiet();
            this.objHDMB = new clsHopDongMuaBan();
            this.objHDMBCT = new clsHopDongMuaBanChiTiet();
            this.objDKCT = new clsChiTietDieuKhoanChungTu();
            this.InitializeComponent();
        }

        private void AdvNhaCungCap_ValueChanged(object sender, EventArgs e)
        {
            if (this.AdvKhachHang.Value.Trim() == "")
            {
                this.CboLienHe.Text = "";
                this.CboLienHe.SelectedValue = "";
                this.CboLienHe.DataSource = null;
            }
            else
            {
                clsDMDoiTuong tuong = new clsDMDoiTuong();
                tuong.Load(this.AdvKhachHang.Value);
                this.CboLienHe.DataSource = tuong.GetContactor(tuong.Khoa);
                this.CboLienHe.ValueMember = "Khoa";
                this.CboLienHe.DisplayMember = "Ten";
                if (this.CboLienHe.Items.Count >= 1)
                {
                    this.CboLienHe.SelectedIndex = 0;
                }
                if (tuong.KhoaLoaiGia.Trim() != "")
                {
                    this.CboLoaiGia.SelectedValue = tuong.KhoaLoaiGia;
                }
                else
                {
                    this.CboLoaiGia.SelectedValue = modGeneral.H_GIACHUAN;
                }
                this.TxtDienThoai.Text = tuong.DienThoai;
                this.TxtFax.Text = tuong.Fax;
                this.TxtMaSoThue.Text = tuong.MaSoThue;
                this.TxtDiaChi.Text = tuong.DiaChi;
            }
        }

        private void AdvNhanVien_ValueChanged(object sender, EventArgs e)
        {
            if (this.AdvNhanVien.Value.Trim() != "")
            {
                clsDMDoiTuong tuong = new clsDMDoiTuong();
                tuong.Load(this.AdvNhanVien.Value);
                this.TxtChucVuBan.Text = tuong.GhiChu;
            }
            else
            {
                this.TxtChucVuBan.Text = "";
            }
        }

        private void CboLoaiTien_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                this.txtTyGia.Value = 0;
            }
            else
            {
                string strCode = this.CboLoaiTien.SelectedValue.ToString();
                clsDMLoaiTien tien = new clsDMLoaiTien();
                tien.LoadByCode(strCode);
                this.txtTyGia.Value = tien.TyGia;
                if (tien.SoLe > 0)
                {
                    this.cFrmFormat = modGeneral.H_FORMATNUMBER + "." + LVYModule.sRight("0000000000", tien.SoLe);
                }
                this.FormatNumber();
                if (tien.TienViet == 1)
                {
                    this.txtTyGia.Enabled = false;
                }
                else
                {
                    this.txtTyGia.Enabled = true;
                }
            }
        }

        public bool CheckIvalid()
        {
            if (LVYModule.ReturnIfNull(this.TxtSoChungTu.Text, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số chứng từ!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (this.objHDMB.IsDuplicateVoucherNo(this.TxtSoChungTu.Text, this.cFrmKhoa))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ n\x00e0y đ\x00e3 tồn tại, bạn h\x00e3y nhập số chứng từ kh\x00e1c!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(this.AdvKhachHang.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập kh\x00e1ch h\x00e0ng mua h\x00e0ng!", ""));
                this.AdvKhachHang.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại tiền!", ""));
                this.CboLoaiTien.Focus();
                return false;
            }
            if (this.objHDMB.TrungSoChungTu(this.TxtSoChungTu.Text.Trim(), this.cFrmKhoa))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ n\x00e0y đ\x00e3 tồn tại, bạn phải nhập số chứng từ kh\x00e1c!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing)) == 0.0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập tỷ gi\x00e1 nguy\x00ean tệ!", ""));
                this.txtTyGia.Focus();
                return false;
            }
            return true;
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
            }
            this.EmptyData();
            this.objSoCT.Load(this.mLoaiChungTu);
            this.TxtSoChungTu.Text = this.objSoCT.CreateVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), 1);
            this.cFrmKhoa = modGeneral.CreatKey("BH_HopDongMuaBan", 15, "");
            this.CboLoaiTien.SelectedValue = modGeneral.H_CURRENCY;
            this.FillDieuKhoanTemplate();
            this.EnabledControl = true;
            if (modGeneral.H_LANGUAGE.Trim().ToUpper() == "VIET")
            {
                this.TxtCongTy.Text = modGeneral.H_COMPANYNAMEVIET;
                this.TxtDiaChiBan.Text = modGeneral.H_ADDRESSVIET;
            }
            else
            {
                this.TxtCongTy.Text = modGeneral.H_COMPANYNAMEANH;
                this.TxtDiaChiBan.Text = modGeneral.H_ADDRESSANH;
            }
            this.TxtMaSoThueBan.Text = modGeneral.H_TAXCODE;
            this.TxtDienThoaiBan.Text = modGeneral.H_TELEPHONE;
            this.TxtFaxBan.Text = modGeneral.H_FAX;
        }

        private void CmdAddRow_Click(object sender, EventArgs e)
        {
            if (this.AdvKhachHang.Value.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập nh\x00e0 cung cấp!", ""));
                this.AdvKhachHang.Focus();
            }
            else if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập loại tiền!", ""));
                this.AdvKhachHang.Focus();
            }
            else if (this.TabDetails.SelectedIndex == 0)
            {
                if ((this.VSlist.Rows.Count <= 1) || (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[this.VSlist.Rows.Count - 1, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != ""))
                {
                    this.VSlist.AddItem("");
                    this.VSlist.Select(this.VSlist.Rows.Count - 1, 2);
                    this.VSlist.Focus();
                }
            }
            else
            {
                this.VSListDieuKhoan.AddItem("");
                this.VSListDieuKhoan.Select(this.VSListDieuKhoan.Rows.Count - 1, 2);
                this.VSListDieuKhoan.Focus();
            }
        }

        private void CmdDel_Click(object sender, EventArgs e)
        {
            if (((LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "") && LVYModule.ConfirmDelete("")) && this.objHDMB.DelData(this.cFrmKhoa))
            {
                this.EmptyData();
                this.EnabledControl = false;
            }
        }

        private void CmdDelRow_Click(object sender, EventArgs e)
        {
            if ((this.VSlist.Rows.Count != 1) && (this.VSlist.Row > 0))
            {
                this.VSlist.RemoveItem(this.VSlist.Row);
            }
        }

        private void CmdEdit_Click(object sender, EventArgs e)
        {
            if (((this.VSlist.Rows.Count != 1) && (this.VSlist.Row > 0)) && (this.cFrmKhoa.Trim() != ""))
            {
                this.EnabledControl = true;
            }
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdFind_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_HopDongMuaBanList.Show();
            MyProject.Forms.Frm_HopDongMuaBanList.BringToFront();
        }

        private void CmdSave_Click(object sender, EventArgs e)
        {
            if (this.CheckIvalid())
            {
                if (!this.SaveDetailsTemp())
                {
                    this.objHDMB.ClearTemp(this.cFrmKhoa);
                }
                else if (Conversions.ToBoolean(Microsoft.VisualBasic.CompilerServices.Operators.NotObject(this.UpdateData())))
                {
                    this.objHDMB.ClearTemp(this.cFrmKhoa);
                }
                else
                {
                    this.EnabledControl = false;
                }
            }
        }

        private void cmdTimDonHang_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_BaoGiaList.Dispose();
            MyProject.Forms.Frm_BaoGiaList.objFrmCall = this;
            MyProject.Forms.Frm_BaoGiaList.strConditions = " ( BG.TinhTrang = 0 or BG.TinhTrang = 1 ) And Rtrim(IsNull(BG.KhoaHopDong,'')) = '' ";
            MyProject.Forms.Frm_BaoGiaList.ShowDialog();
        }

        private void CmdUnsave_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoaOld != "")
            {
                this.cFrmKhoa = this.cFrmKhoaOld;
                this.ShowData(this.cFrmKhoa);
            }
            else
            {
                this.EmptyData();
            }
            this.EnabledControl = false;
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        public void EmptyData()
        {
            this.TxtSoChungTu.Text = "";
            this.TxtNgayChungTu.Text = Strings.Format(DateAndTime.Today, "dd/MM/yyyy");
            this.AdvKhachHang.Value = "";
            this.CboLienHe.SelectedValue = "";
            this.CboLoaiGia.SelectedValue = "";
            this.TxtChucVu.Text = "";
            this.TxtDienThoai.Text = "";
            this.TxtFax.Text = "";
            this.CboLoaiTien.SelectedValue = "";
            this.AdvNhanVien.Value = "";
            this.VSlist.Select(0, 0);
            this.VSlist.Rows.Count = 1;
            this.VSListDieuKhoan.Select(0, 0);
            this.VSListDieuKhoan.Rows.Count = 1;
            this.TxtSoChungTu.Focus();
        }

        public void FillDieuKhoanTemplate()
        {
            DataTable dieuKhoanTemplate = this.objHDMB.GetDieuKhoanTemplate("HD");
            this.VSListDieuKhoan.Select(0, 0);
            this.VSListDieuKhoan.Rows.Count = 1;
            int num2 = dieuKhoanTemplate.Rows.Count - 1;
            for (int i = 0; i <= num2; i++)
            {
                this.VSListDieuKhoan.AddItem("");
                this.VSListDieuKhoan[this.VSListDieuKhoan.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(dieuKhoanTemplate.Rows[i]["KhoaDieuKhoan"]);
                this.VSListDieuKhoan[this.VSListDieuKhoan.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(dieuKhoanTemplate.Rows[i]["DieuKhoan"]);
                this.VSListDieuKhoan[this.VSListDieuKhoan.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(dieuKhoanTemplate.Rows[i]["NoiDungViet"]);
                this.VSListDieuKhoan[this.VSListDieuKhoan.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(dieuKhoanTemplate.Rows[i]["NoiDungAnh"]);
            }
        }

        public void FormatNumber()
        {
            LVYModule.advFormatNumber(this.txtTyGia, this.cFrmFormat);
            this.VSlist.Cols[15].DataType = System.Type.GetType("System.Decimal");
            this.VSlist.Cols[0x12].DataType = System.Type.GetType("System.Decimal");
            this.VSlist.Cols[15].Format = this.cFrmFormat;
            this.VSlist.Cols[0x12].Format = this.cFrmFormat;
        }

        private void Frm_BaoGia_KeyDown(object sender, KeyEventArgs e)
        {
            Keys keyCode = e.KeyCode;
            if (keyCode == Keys.Escape)
            {
                if (this.CmdExit.Enabled)
                {
                    this.CmdExit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F2)
            {
                if (this.CmdEdit.Enabled)
                {
                    this.CmdEdit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F3)
            {
                this.CmdFind_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
            else if (keyCode == Keys.F5)
            {
                this.TabDetails.SelectedIndex = 0;
            }
            else if (keyCode == Keys.F6)
            {
                this.TabDetails.SelectedIndex = 1;
            }
            else if (keyCode == Keys.F8)
            {
                if (this.CmdAdd.Enabled)
                {
                    this.CmdAdd_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F9)
            {
                if (this.CmdDel.Enabled)
                {
                    this.CmdDel_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F10)
            {
                if (this.CmdSave.Enabled)
                {
                    this.CmdSave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if ((keyCode == Keys.F11) && this.CmdUnsave.Enabled)
            {
                this.CmdUnsave_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
        }

        private void Frm_BaoGia_Load(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.EmptyData();
                this.EnabledControl = false;
                BuildComboModule.BuildCombo(this.CboLoaiTien, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
                BuildComboModule.BuildCombo(this.CboLoaiGia, modGeneral.ListDanhMuc.LoaiGiaBan, false, "", "");
                BuildComboModule.BuildCombo(this.CboLienHe, modGeneral.ListDanhMuc.LoaiKhachHang, false, "", "");
                this.cFrmFormat = modGeneral.H_FORMATNUMBER;
                if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    this.EmptyData();
                }
                else
                {
                    this.SetLanguage();
                    this.ShowData(this.cFrmKhoa);
                }
                this.Cursor = Cursors.Default;
            }
        }

        public void GetDieuKhoan(object pKhoa)
        {
            DataTable dieuKhoan = this.objHDMB.GetDieuKhoan(Conversions.ToString(pKhoa));
            this.VSListDieuKhoan.Select(0, 0);
            this.VSListDieuKhoan.Rows.Count = 1;
            int num2 = dieuKhoan.Rows.Count - 1;
            for (int i = 0; i <= num2; i++)
            {
                this.VSListDieuKhoan.AddItem("");
                this.VSListDieuKhoan[this.VSListDieuKhoan.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(dieuKhoan.Rows[i]["Khoa"]);
                this.VSListDieuKhoan[this.VSListDieuKhoan.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(dieuKhoan.Rows[i]["KhoaDieuKhoan"]);
                this.VSListDieuKhoan[this.VSListDieuKhoan.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(dieuKhoan.Rows[i]["DieuKhoan"]);
                this.VSListDieuKhoan[this.VSListDieuKhoan.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(dieuKhoan.Rows[i]["NoiDungViet"]);
                this.VSListDieuKhoan[this.VSListDieuKhoan.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(dieuKhoan.Rows[i]["NoiDungAnh"]);
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_HopDongMuaBan));
            this.TxtTienThue = new C1NumericEdit();
            this.Label15 = new Label();
            this.TxtTongCong = new C1NumericEdit();
            this.Label14 = new Label();
            this.TxtSoTien = new C1NumericEdit();
            this.TabDetails = new TabControl();
            this.TabPage4 = new TabPage();
            this.VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.TabPage2 = new TabPage();
            this.VSListDieuKhoan = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.TabPage1 = new TabPage();
            this.Panel1 = new Panel();
            this.CboLoaiGia = new ComboBox();
            this.Label3 = new Label();
            this.Label7 = new Label();
            this.TxtHanGiaoHang = new DateTimePicker();
            this.CboLoaiTien = new ComboBox();
            this.txtTyGia = new C1NumericEdit();
            this.Label11 = new Label();
            this.Label10 = new Label();
            this.cmdTimDonHang = new Button();
            this.Label12 = new Label();
            this.TxtNgayDathang = new DateTimePicker();
            this.Label20 = new Label();
            this.TxtSoBaoGia = new TextBox();
            this.Label13 = new Label();
            this.TxtNgayChungTu = new DateTimePicker();
            this.Label1 = new Label();
            this.TxtSoChungTu = new TextBox();
            this.GroupBox2 = new GroupBox();
            this.TxtChucVuBan = new TextBox();
            this.Label26 = new Label();
            this.TxtFaxBan = new TextBox();
            this.Label23 = new Label();
            this.TxtMaSoThueBan = new TextBox();
            this.TxtDienThoaiBan = new TextBox();
            this.Label24 = new Label();
            this.Label25 = new Label();
            this.TxtDiaChiBan = new TextBox();
            this.Label22 = new Label();
            this.TxtCongTy = new TextBox();
            this.Label21 = new Label();
            this.Label17 = new Label();
            this.AdvNhanVien = new ADVObjects();
            this.GroupBox1 = new GroupBox();
            this.TxtChucVu = new TextBox();
            this.Label9 = new Label();
            this.TxtFax = new TextBox();
            this.Label4 = new Label();
            this.Label16 = new Label();
            this.AdvKhachHang = new ADVObjects();
            this.TxtMaSoThue = new TextBox();
            this.CboLienHe = new ComboBox();
            this.Label2 = new Label();
            this.TxtDiaChi = new TextBox();
            this.Label18 = new Label();
            this.TxtDienThoai = new TextBox();
            this.Label8 = new Label();
            this.Label6 = new Label();
            this.TabControl1 = new TabControl();
            this.Panel5 = new Panel();
            this.Label5 = new Label();
            this.Panel4 = new Panel();
            this.CmdDelRow = new Button();
            this.CmdAddRow = new Button();
            this.ToolStrip1 = new ToolStrip();
            this.CmdAdd = new ToolStripButton();
            this.CmdEdit = new ToolStripButton();
            this.ToolStripSeparator2 = new ToolStripSeparator();
            this.CmdSave = new ToolStripButton();
            this.CmdUnsave = new ToolStripButton();
            this.ToolStripSeparator1 = new ToolStripSeparator();
            this.CmdFind = new ToolStripButton();
            this.CmdPrint = new ToolStripButton();
            this.ToolStripButton1 = new ToolStripSeparator();
            this.CmdDel = new ToolStripButton();
            this.ToolStripSeparator3 = new ToolStripSeparator();
            this.CmdExit = new ToolStripButton();
            this.CmdHelp = new ToolStripButton();
            this.CmdDieuKhoanMacDinh = new ToolStripButton();
            ((ISupportInitialize) this.TxtTienThue).BeginInit();
            ((ISupportInitialize) this.TxtTongCong).BeginInit();
            ((ISupportInitialize) this.TxtSoTien).BeginInit();
            this.TabDetails.SuspendLayout();
            this.TabPage4.SuspendLayout();
            this.VSlist.BeginInit();
            this.TabPage2.SuspendLayout();
            this.VSListDieuKhoan.BeginInit();
            this.TabPage1.SuspendLayout();
            this.Panel1.SuspendLayout();
            ((ISupportInitialize) this.txtTyGia).BeginInit();
            this.GroupBox2.SuspendLayout();
            this.GroupBox1.SuspendLayout();
            this.TabControl1.SuspendLayout();
            this.Panel5.SuspendLayout();
            this.Panel4.SuspendLayout();
            this.ToolStrip1.SuspendLayout();
            this.SuspendLayout();
            this.TxtTienThue.FormatType = FormatTypeEnum.StandardNumber;
            Point point = new Point(0x5f, 0x19);
            this.TxtTienThue.Location = point;
            this.TxtTienThue.Name = "TxtTienThue";
            this.TxtTienThue.ReadOnly = true;
            Size size = new Size(0x6d, 20);
            this.TxtTienThue.Size = size;
            this.TxtTienThue.TabIndex = 0x24;
            this.TxtTienThue.Tag = null;
            this.TxtTienThue.TextAlign = HorizontalAlignment.Right;
            decimal num = new decimal(new int[] { 0, 0, 0, 0 });
            this.TxtTienThue.Value = num;
            this.TxtTienThue.VisibleButtons = DropDownControlButtonFlags.None;
            this.Label15.AutoEllipsis = true;
            this.Label15.AutoSize = true;
            this.Label15.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xa3);
            point = new Point(10, 0x1c);
            this.Label15.Location = point;
            this.Label15.Name = "Label15";
            this.Label15.RightToLeft = RightToLeft.No;
            size = new Size(0x3d, 13);
            this.Label15.Size = size;
            this.Label15.TabIndex = 0x22;
            this.Label15.Text = "Tiền thuế";
            this.Label15.TextAlign = ContentAlignment.TopRight;
            this.TxtTongCong.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x5f, 0x2f);
            this.TxtTongCong.Location = point;
            this.TxtTongCong.Name = "TxtTongCong";
            this.TxtTongCong.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtTongCong.Size = size;
            this.TxtTongCong.TabIndex = 0x2a;
            this.TxtTongCong.Tag = null;
            this.TxtTongCong.TextAlign = HorizontalAlignment.Right;
            num = new decimal(new int[] { 0, 0, 0, 0 });
            this.TxtTongCong.Value = num;
            this.TxtTongCong.VisibleButtons = DropDownControlButtonFlags.None;
            this.Label14.AutoEllipsis = true;
            this.Label14.AutoSize = true;
            this.Label14.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xa3);
            point = new Point(10, 50);
            this.Label14.Location = point;
            this.Label14.Name = "Label14";
            this.Label14.RightToLeft = RightToLeft.No;
            size = new Size(0x44, 13);
            this.Label14.Size = size;
            this.Label14.TabIndex = 40;
            this.Label14.Text = "Tổng cộng";
            this.Label14.TextAlign = ContentAlignment.TopRight;
            this.TxtSoTien.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x5f, 3);
            this.TxtSoTien.Location = point;
            this.TxtSoTien.Name = "TxtSoTien";
            this.TxtSoTien.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtSoTien.Size = size;
            this.TxtSoTien.TabIndex = 0x21;
            this.TxtSoTien.Tag = null;
            this.TxtSoTien.TextAlign = HorizontalAlignment.Right;
            num = new decimal(new int[] { 0, 0, 0, 0 });
            this.TxtSoTien.Value = num;
            this.TxtSoTien.VisibleButtons = DropDownControlButtonFlags.None;
            this.TabDetails.Controls.Add(this.TabPage4);
            this.TabDetails.Controls.Add(this.TabPage2);
            this.TabDetails.Dock = DockStyle.Fill;
            point = new Point(0, 0xfc);
            this.TabDetails.Location = point;
            Padding padding = new Padding(3, 3, 0, 3);
            this.TabDetails.Margin = padding;
            this.TabDetails.Name = "TabDetails";
            this.TabDetails.SelectedIndex = 0;
            size = new Size(0x336, 0x11c);
            this.TabDetails.Size = size;
            this.TabDetails.TabIndex = 0x2f;
            this.TabPage4.Controls.Add(this.VSlist);
            point = new Point(4, 0x16);
            this.TabPage4.Location = point;
            this.TabPage4.Name = "TabPage4";
            padding = new Padding(3);
            this.TabPage4.Padding = padding;
            size = new Size(0x32e, 0x102);
            this.TabPage4.Size = size;
            this.TabPage4.TabIndex = 2;
            this.TabPage4.Text = "F5. Chi tiết h\x00e0ng h\x00f3a";
            this.TabPage4.UseVisualStyleBackColor = true;
            this.VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSlist.ColumnInfo = manager.GetString("VSlist.ColumnInfo");
            this.VSlist.Dock = DockStyle.Fill;
            this.VSlist.ExtendLastCol = true;
            this.VSlist.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(3, 3);
            this.VSlist.Location = point;
            this.VSlist.Name = "VSlist";
            this.VSlist.Rows.Count = 1;
            size = new Size(0x328, 0xfc);
            this.VSlist.Size = size;
            this.VSlist.Styles = new CellStyleCollection(manager.GetString("VSlist.Styles"));
            this.VSlist.TabIndex = 30;
            this.TabPage2.Controls.Add(this.VSListDieuKhoan);
            point = new Point(4, 0x16);
            this.TabPage2.Location = point;
            this.TabPage2.Name = "TabPage2";
            padding = new Padding(3);
            this.TabPage2.Padding = padding;
            size = new Size(0x32e, 0x102);
            this.TabPage2.Size = size;
            this.TabPage2.TabIndex = 3;
            this.TabPage2.Text = "F6. Điều khoản hợp đồng";
            this.TabPage2.UseVisualStyleBackColor = true;
            this.VSListDieuKhoan.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSListDieuKhoan.ColumnInfo = manager.GetString("VSListDieuKhoan.ColumnInfo");
            this.VSListDieuKhoan.Dock = DockStyle.Fill;
            this.VSListDieuKhoan.ExtendLastCol = true;
            this.VSListDieuKhoan.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(3, 3);
            this.VSListDieuKhoan.Location = point;
            this.VSListDieuKhoan.Name = "VSListDieuKhoan";
            this.VSListDieuKhoan.Rows.Count = 1;
            size = new Size(0x328, 0xfc);
            this.VSListDieuKhoan.Size = size;
            this.VSListDieuKhoan.Styles = new CellStyleCollection(manager.GetString("VSListDieuKhoan.Styles"));
            this.VSListDieuKhoan.TabIndex = 0x1f;
            this.TabPage1.Controls.Add(this.Panel1);
            this.TabPage1.Controls.Add(this.GroupBox2);
            this.TabPage1.Controls.Add(this.GroupBox1);
            point = new Point(4, 0x16);
            this.TabPage1.Location = point;
            this.TabPage1.Name = "TabPage1";
            size = new Size(0x32e, 0xc9);
            this.TabPage1.Size = size;
            this.TabPage1.TabIndex = 0;
            this.TabPage1.Text = "Th\x00f4ng tin hợp đồng";
            this.TabPage1.UseVisualStyleBackColor = true;
            this.Panel1.BackColor = Color.PaleTurquoise;
            this.Panel1.Controls.Add(this.CboLoaiGia);
            this.Panel1.Controls.Add(this.Label3);
            this.Panel1.Controls.Add(this.Label7);
            this.Panel1.Controls.Add(this.TxtHanGiaoHang);
            this.Panel1.Controls.Add(this.CboLoaiTien);
            this.Panel1.Controls.Add(this.txtTyGia);
            this.Panel1.Controls.Add(this.Label11);
            this.Panel1.Controls.Add(this.Label10);
            this.Panel1.Controls.Add(this.cmdTimDonHang);
            this.Panel1.Controls.Add(this.Label12);
            this.Panel1.Controls.Add(this.TxtNgayDathang);
            this.Panel1.Controls.Add(this.Label20);
            this.Panel1.Controls.Add(this.TxtSoBaoGia);
            this.Panel1.Controls.Add(this.Label13);
            this.Panel1.Controls.Add(this.TxtNgayChungTu);
            this.Panel1.Controls.Add(this.Label1);
            this.Panel1.Controls.Add(this.TxtSoChungTu);
            this.Panel1.Dock = DockStyle.Top;
            point = new Point(0, 0);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            size = new Size(0x32e, 0x37);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0x6c;
            this.CboLoaiGia.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiGia.FormattingEnabled = true;
            point = new Point(0x1f0, 30);
            this.CboLoaiGia.Location = point;
            this.CboLoaiGia.Name = "CboLoaiGia";
            size = new Size(0x7d, 0x15);
            this.CboLoaiGia.Size = size;
            this.CboLoaiGia.TabIndex = 14;
            this.Label3.AutoSize = true;
            point = new Point(0x1a6, 0x22);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x2c, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 13;
            this.Label3.Text = "Loại gi\x00e1";
            this.Label3.TextAlign = ContentAlignment.TopRight;
            this.Label7.AutoSize = true;
            point = new Point(0x275, 0x21);
            this.Label7.Location = point;
            this.Label7.Name = "Label7";
            size = new Size(0x44, 13);
            this.Label7.Size = size;
            this.Label7.TabIndex = 15;
            this.Label7.Text = "Hiệu lực đến";
            this.TxtHanGiaoHang.Format = DateTimePickerFormat.Short;
            point = new Point(0x2c1, 30);
            this.TxtHanGiaoHang.Location = point;
            this.TxtHanGiaoHang.Name = "TxtHanGiaoHang";
            size = new Size(0x65, 20);
            this.TxtHanGiaoHang.Size = size;
            this.TxtHanGiaoHang.TabIndex = 0x10;
            this.CboLoaiTien.FormattingEnabled = true;
            point = new Point(90, 0x1f);
            this.CboLoaiTien.Location = point;
            this.CboLoaiTien.Name = "CboLoaiTien";
            size = new Size(0x70, 0x15);
            this.CboLoaiTien.Size = size;
            this.CboLoaiTien.TabIndex = 10;
            this.txtTyGia.DataType = typeof(double);
            this.txtTyGia.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x11a, 0x1f);
            this.txtTyGia.Location = point;
            this.txtTyGia.Name = "txtTyGia";
            size = new Size(100, 20);
            this.txtTyGia.Size = size;
            this.txtTyGia.TabIndex = 12;
            this.txtTyGia.Tag = null;
            this.txtTyGia.TextAlign = HorizontalAlignment.Right;
            this.txtTyGia.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.Label11.AutoSize = true;
            point = new Point(4, 0x22);
            this.Label11.Location = point;
            this.Label11.Name = "Label11";
            size = new Size(0x2f, 13);
            this.Label11.Size = size;
            this.Label11.TabIndex = 9;
            this.Label11.Text = "Loại tiền";
            this.Label11.TextAlign = ContentAlignment.TopRight;
            this.Label10.AutoSize = true;
            point = new Point(0xec, 0x23);
            this.Label10.Location = point;
            this.Label10.Name = "Label10";
            size = new Size(0x24, 13);
            this.Label10.Size = size;
            this.Label10.TabIndex = 11;
            this.Label10.Text = "Tỷ gi\x00e1";
            this.Label10.TextAlign = ContentAlignment.TopRight;
            this.cmdTimDonHang.BackgroundImage = ACCOUNTING.My.Resources.Resources.view;
            this.cmdTimDonHang.BackgroundImageLayout = ImageLayout.Stretch;
            point = new Point(0x257, 5);
            this.cmdTimDonHang.Location = point;
            padding = new Padding(0);
            this.cmdTimDonHang.Margin = padding;
            this.cmdTimDonHang.Name = "cmdTimDonHang";
            size = new Size(0x17, 0x16);
            this.cmdTimDonHang.Size = size;
            this.cmdTimDonHang.TabIndex = 6;
            this.cmdTimDonHang.UseVisualStyleBackColor = true;
            this.Label12.AutoSize = true;
            point = new Point(0x275, 9);
            this.Label12.Location = point;
            this.Label12.Name = "Label12";
            size = new Size(0x20, 13);
            this.Label12.Size = size;
            this.Label12.TabIndex = 7;
            this.Label12.Text = "Ng\x00e0y";
            this.TxtNgayDathang.Enabled = false;
            this.TxtNgayDathang.Format = DateTimePickerFormat.Custom;
            point = new Point(0x2c1, 6);
            this.TxtNgayDathang.Location = point;
            this.TxtNgayDathang.Name = "TxtNgayDathang";
            size = new Size(0x65, 20);
            this.TxtNgayDathang.Size = size;
            this.TxtNgayDathang.TabIndex = 8;
            this.Label20.AutoSize = true;
            point = new Point(0x1a5, 9);
            this.Label20.Location = point;
            this.Label20.Name = "Label20";
            size = new Size(0x39, 13);
            this.Label20.Size = size;
            this.Label20.TabIndex = 4;
            this.Label20.Text = "B\x00e1o gi\x00e1 số";
            this.TxtSoBaoGia.Enabled = false;
            point = new Point(0x1f0, 6);
            this.TxtSoBaoGia.Location = point;
            this.TxtSoBaoGia.Name = "TxtSoBaoGia";
            this.TxtSoBaoGia.ReadOnly = true;
            size = new Size(0x67, 20);
            this.TxtSoBaoGia.Size = size;
            this.TxtSoBaoGia.TabIndex = 5;
            this.Label13.AutoSize = true;
            point = new Point(0xec, 10);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x20, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 2;
            this.Label13.Text = "Ng\x00e0y";
            this.TxtNgayChungTu.Format = DateTimePickerFormat.Short;
            point = new Point(0x11a, 7);
            this.TxtNgayChungTu.Location = point;
            this.TxtNgayChungTu.Name = "TxtNgayChungTu";
            size = new Size(100, 20);
            this.TxtNgayChungTu.Size = size;
            this.TxtNgayChungTu.TabIndex = 3;
            this.Label1.AutoSize = true;
            point = new Point(5, 10);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x45, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0;
            this.Label1.Text = "Số hợp đồng";
            point = new Point(90, 7);
            this.TxtSoChungTu.Location = point;
            this.TxtSoChungTu.Name = "TxtSoChungTu";
            size = new Size(0x70, 20);
            this.TxtSoChungTu.Size = size;
            this.TxtSoChungTu.TabIndex = 1;
            this.GroupBox2.Controls.Add(this.TxtChucVuBan);
            this.GroupBox2.Controls.Add(this.Label26);
            this.GroupBox2.Controls.Add(this.TxtFaxBan);
            this.GroupBox2.Controls.Add(this.Label23);
            this.GroupBox2.Controls.Add(this.TxtMaSoThueBan);
            this.GroupBox2.Controls.Add(this.TxtDienThoaiBan);
            this.GroupBox2.Controls.Add(this.Label24);
            this.GroupBox2.Controls.Add(this.Label25);
            this.GroupBox2.Controls.Add(this.TxtDiaChiBan);
            this.GroupBox2.Controls.Add(this.Label22);
            this.GroupBox2.Controls.Add(this.TxtCongTy);
            this.GroupBox2.Controls.Add(this.Label21);
            this.GroupBox2.Controls.Add(this.Label17);
            this.GroupBox2.Controls.Add(this.AdvNhanVien);
            point = new Point(5, 0x38);
            this.GroupBox2.Location = point;
            this.GroupBox2.Name = "GroupBox2";
            size = new Size(0x18e, 0x8e);
            this.GroupBox2.Size = size;
            this.GroupBox2.TabIndex = 0x6b;
            this.GroupBox2.TabStop = false;
            this.GroupBox2.Text = "B\x00ean b\x00e1n";
            point = new Point(0x54, 0x74);
            this.TxtChucVuBan.Location = point;
            this.TxtChucVuBan.Name = "TxtChucVuBan";
            size = new Size(0x134, 20);
            this.TxtChucVuBan.Size = size;
            this.TxtChucVuBan.TabIndex = 30;
            this.Label26.AutoEllipsis = true;
            this.Label26.AutoSize = true;
            point = new Point(9, 0x76);
            this.Label26.Location = point;
            this.Label26.Name = "Label26";
            this.Label26.RightToLeft = RightToLeft.No;
            size = new Size(0x3b, 13);
            this.Label26.Size = size;
            this.Label26.TabIndex = 0x1d;
            this.Label26.Text = "Chức danh";
            this.Label26.TextAlign = ContentAlignment.TopRight;
            point = new Point(0x13d, 0x43);
            this.TxtFaxBan.Location = point;
            this.TxtFaxBan.Name = "TxtFaxBan";
            size = new Size(0x4b, 20);
            this.TxtFaxBan.Size = size;
            this.TxtFaxBan.TabIndex = 0x1a;
            this.Label23.AutoEllipsis = true;
            this.Label23.AutoSize = true;
            point = new Point(9, 0x45);
            this.Label23.Location = point;
            this.Label23.Name = "Label23";
            this.Label23.RightToLeft = RightToLeft.No;
            size = new Size(60, 13);
            this.Label23.Size = size;
            this.Label23.TabIndex = 0x15;
            this.Label23.Text = "M\x00e3 số thuế";
            this.Label23.TextAlign = ContentAlignment.TopRight;
            point = new Point(0x54, 0x43);
            this.TxtMaSoThueBan.Location = point;
            this.TxtMaSoThueBan.Name = "TxtMaSoThueBan";
            size = new Size(0x49, 20);
            this.TxtMaSoThueBan.Size = size;
            this.TxtMaSoThueBan.TabIndex = 0x16;
            point = new Point(0xd3, 0x43);
            this.TxtDienThoaiBan.Location = point;
            this.TxtDienThoaiBan.Name = "TxtDienThoaiBan";
            size = new Size(0x4a, 20);
            this.TxtDienThoaiBan.Size = size;
            this.TxtDienThoaiBan.TabIndex = 0x18;
            this.Label24.AutoEllipsis = true;
            this.Label24.AutoSize = true;
            point = new Point(0x121, 70);
            this.Label24.Location = point;
            this.Label24.Name = "Label24";
            this.Label24.RightToLeft = RightToLeft.No;
            size = new Size(0x18, 13);
            this.Label24.Size = size;
            this.Label24.TabIndex = 0x19;
            this.Label24.Text = "Fax";
            this.Label24.TextAlign = ContentAlignment.TopRight;
            this.Label25.AutoEllipsis = true;
            this.Label25.AutoSize = true;
            point = new Point(0x9c, 70);
            this.Label25.Location = point;
            this.Label25.Name = "Label25";
            this.Label25.RightToLeft = RightToLeft.No;
            size = new Size(0x37, 13);
            this.Label25.Size = size;
            this.Label25.TabIndex = 0x17;
            this.Label25.Text = "Điện thoại";
            this.Label25.TextAlign = ContentAlignment.TopRight;
            point = new Point(0x54, 0x2b);
            this.TxtDiaChiBan.Location = point;
            this.TxtDiaChiBan.Name = "TxtDiaChiBan";
            size = new Size(0x134, 20);
            this.TxtDiaChiBan.Size = size;
            this.TxtDiaChiBan.TabIndex = 20;
            this.Label22.AutoEllipsis = true;
            this.Label22.AutoSize = true;
            point = new Point(9, 0x2d);
            this.Label22.Location = point;
            this.Label22.Name = "Label22";
            this.Label22.RightToLeft = RightToLeft.No;
            size = new Size(40, 13);
            this.Label22.Size = size;
            this.Label22.TabIndex = 0x13;
            this.Label22.Text = "Địa chỉ";
            this.Label22.TextAlign = ContentAlignment.TopRight;
            point = new Point(0x54, 0x13);
            this.TxtCongTy.Location = point;
            this.TxtCongTy.Name = "TxtCongTy";
            size = new Size(0x134, 20);
            this.TxtCongTy.Size = size;
            this.TxtCongTy.TabIndex = 0x12;
            this.Label21.AutoEllipsis = true;
            this.Label21.AutoSize = true;
            point = new Point(9, 0x15);
            this.Label21.Location = point;
            this.Label21.Name = "Label21";
            this.Label21.RightToLeft = RightToLeft.No;
            size = new Size(0x2b, 13);
            this.Label21.Size = size;
            this.Label21.TabIndex = 0x11;
            this.Label21.Text = "C\x00f4ng ty";
            this.Label21.TextAlign = ContentAlignment.TopRight;
            this.Label17.AutoEllipsis = true;
            this.Label17.AutoSize = true;
            point = new Point(9, 0x5e);
            this.Label17.Location = point;
            this.Label17.Name = "Label17";
            this.Label17.RightToLeft = RightToLeft.No;
            size = new Size(0x2e, 13);
            this.Label17.Size = size;
            this.Label17.TabIndex = 0x1b;
            this.Label17.Text = "Đại diện";
            this.Label17.TextAlign = ContentAlignment.TopRight;
            this.AdvNhanVien.LoaiDoiTuong = modGeneral.TypeObjects.NhanVien;
            point = new Point(0x54, 0x5b);
            this.AdvNhanVien.Location = point;
            this.AdvNhanVien.Name = "AdvNhanVien";
            this.AdvNhanVien.ReadOnly = false;
            size = new Size(0x134, 20);
            this.AdvNhanVien.Size = size;
            this.AdvNhanVien.TabIndex = 0x1c;
            this.AdvNhanVien.UpperText = true;
            this.AdvNhanVien.Value = "";
            this.AdvNhanVien.WidthCode = 80;
            this.GroupBox1.Controls.Add(this.TxtChucVu);
            this.GroupBox1.Controls.Add(this.Label9);
            this.GroupBox1.Controls.Add(this.TxtFax);
            this.GroupBox1.Controls.Add(this.Label4);
            this.GroupBox1.Controls.Add(this.Label16);
            this.GroupBox1.Controls.Add(this.AdvKhachHang);
            this.GroupBox1.Controls.Add(this.TxtMaSoThue);
            this.GroupBox1.Controls.Add(this.CboLienHe);
            this.GroupBox1.Controls.Add(this.Label2);
            this.GroupBox1.Controls.Add(this.TxtDiaChi);
            this.GroupBox1.Controls.Add(this.Label18);
            this.GroupBox1.Controls.Add(this.TxtDienThoai);
            this.GroupBox1.Controls.Add(this.Label8);
            this.GroupBox1.Controls.Add(this.Label6);
            point = new Point(0x19b, 0x38);
            this.GroupBox1.Location = point;
            this.GroupBox1.Name = "GroupBox1";
            size = new Size(0x18e, 0x8e);
            this.GroupBox1.Size = size;
            this.GroupBox1.TabIndex = 0x6a;
            this.GroupBox1.TabStop = false;
            this.GroupBox1.Text = "B\x00ean mua";
            point = new Point(0x55, 0x74);
            this.TxtChucVu.Location = point;
            this.TxtChucVu.Name = "TxtChucVu";
            size = new Size(0x134, 20);
            this.TxtChucVu.Size = size;
            this.TxtChucVu.TabIndex = 0x2c;
            this.Label9.AutoEllipsis = true;
            this.Label9.AutoSize = true;
            point = new Point(12, 0x76);
            this.Label9.Location = point;
            this.Label9.Name = "Label9";
            this.Label9.RightToLeft = RightToLeft.No;
            size = new Size(0x3b, 13);
            this.Label9.Size = size;
            this.Label9.TabIndex = 0x2b;
            this.Label9.Text = "Chức danh";
            this.Label9.TextAlign = ContentAlignment.TopRight;
            point = new Point(0x141, 0x43);
            this.TxtFax.Location = point;
            this.TxtFax.Name = "TxtFax";
            size = new Size(0x48, 20);
            this.TxtFax.Size = size;
            this.TxtFax.TabIndex = 40;
            this.Label4.AutoEllipsis = true;
            this.Label4.AutoSize = true;
            point = new Point(12, 70);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            this.Label4.RightToLeft = RightToLeft.No;
            size = new Size(60, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 0x23;
            this.Label4.Text = "M\x00e3 số thuế";
            this.Label4.TextAlign = ContentAlignment.TopRight;
            this.Label16.AutoEllipsis = true;
            this.Label16.AutoSize = true;
            point = new Point(12, 0x16);
            this.Label16.Location = point;
            this.Label16.Name = "Label16";
            this.Label16.RightToLeft = RightToLeft.No;
            size = new Size(0x41, 13);
            this.Label16.Size = size;
            this.Label16.TabIndex = 0x1f;
            this.Label16.Text = "Kh\x00e1ch h\x00e0ng";
            this.Label16.TextAlign = ContentAlignment.TopRight;
            this.AdvKhachHang.LoaiDoiTuong = modGeneral.TypeObjects.KhachHang;
            point = new Point(0x55, 0x13);
            this.AdvKhachHang.Location = point;
            this.AdvKhachHang.Name = "AdvKhachHang";
            this.AdvKhachHang.ReadOnly = false;
            size = new Size(0x134, 20);
            this.AdvKhachHang.Size = size;
            this.AdvKhachHang.TabIndex = 0x20;
            this.AdvKhachHang.UpperText = true;
            this.AdvKhachHang.Value = "";
            this.AdvKhachHang.WidthCode = 80;
            point = new Point(0x55, 0x43);
            this.TxtMaSoThue.Location = point;
            this.TxtMaSoThue.Name = "TxtMaSoThue";
            size = new Size(0x49, 20);
            this.TxtMaSoThue.Size = size;
            this.TxtMaSoThue.TabIndex = 0x24;
            this.CboLienHe.FormattingEnabled = true;
            point = new Point(0x55, 0x5b);
            this.CboLienHe.Location = point;
            this.CboLienHe.Name = "CboLienHe";
            size = new Size(0x134, 0x15);
            this.CboLienHe.Size = size;
            this.CboLienHe.TabIndex = 0x2a;
            this.Label2.AutoEllipsis = true;
            this.Label2.AutoSize = true;
            point = new Point(12, 0x5e);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            this.Label2.RightToLeft = RightToLeft.No;
            size = new Size(0x2e, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x29;
            this.Label2.Text = "Đại diện";
            this.Label2.TextAlign = ContentAlignment.TopRight;
            point = new Point(0x55, 0x2b);
            this.TxtDiaChi.Location = point;
            this.TxtDiaChi.Name = "TxtDiaChi";
            size = new Size(0x134, 20);
            this.TxtDiaChi.Size = size;
            this.TxtDiaChi.TabIndex = 0x22;
            this.Label18.AutoEllipsis = true;
            this.Label18.AutoSize = true;
            point = new Point(12, 0x2d);
            this.Label18.Location = point;
            this.Label18.Name = "Label18";
            this.Label18.RightToLeft = RightToLeft.No;
            size = new Size(40, 13);
            this.Label18.Size = size;
            this.Label18.TabIndex = 0x21;
            this.Label18.Text = "Địa chỉ";
            this.Label18.TextAlign = ContentAlignment.TopRight;
            point = new Point(0xd7, 0x43);
            this.TxtDienThoai.Location = point;
            this.TxtDienThoai.Name = "TxtDienThoai";
            size = new Size(0x4a, 20);
            this.TxtDienThoai.Size = size;
            this.TxtDienThoai.TabIndex = 0x26;
            this.Label8.AutoEllipsis = true;
            this.Label8.AutoSize = true;
            point = new Point(0x125, 70);
            this.Label8.Location = point;
            this.Label8.Name = "Label8";
            this.Label8.RightToLeft = RightToLeft.No;
            size = new Size(0x18, 13);
            this.Label8.Size = size;
            this.Label8.TabIndex = 0x27;
            this.Label8.Text = "Fax";
            this.Label8.TextAlign = ContentAlignment.TopRight;
            this.Label6.AutoEllipsis = true;
            this.Label6.AutoSize = true;
            point = new Point(160, 0x47);
            this.Label6.Location = point;
            this.Label6.Name = "Label6";
            this.Label6.RightToLeft = RightToLeft.No;
            size = new Size(0x37, 13);
            this.Label6.Size = size;
            this.Label6.TabIndex = 0x25;
            this.Label6.Text = "Điện thoại";
            this.Label6.TextAlign = ContentAlignment.TopRight;
            this.TabControl1.Controls.Add(this.TabPage1);
            this.TabControl1.Dock = DockStyle.Top;
            point = new Point(0, 0x19);
            this.TabControl1.Location = point;
            this.TabControl1.Name = "TabControl1";
            this.TabControl1.SelectedIndex = 0;
            size = new Size(0x336, 0xe3);
            this.TabControl1.Size = size;
            this.TabControl1.TabIndex = 0x2e;
            this.Panel5.Controls.Add(this.TxtTienThue);
            this.Panel5.Controls.Add(this.Label15);
            this.Panel5.Controls.Add(this.TxtTongCong);
            this.Panel5.Controls.Add(this.Label14);
            this.Panel5.Controls.Add(this.TxtSoTien);
            this.Panel5.Controls.Add(this.Label5);
            this.Panel5.Dock = DockStyle.Right;
            point = new Point(0x267, 0);
            this.Panel5.Location = point;
            this.Panel5.Name = "Panel5";
            size = new Size(0xcf, 0x48);
            this.Panel5.Size = size;
            this.Panel5.TabIndex = 0;
            this.Label5.AutoEllipsis = true;
            this.Label5.AutoSize = true;
            this.Label5.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xa3);
            point = new Point(10, 6);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            this.Label5.RightToLeft = RightToLeft.No;
            size = new Size(0x40, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0x1f;
            this.Label5.Text = "Tiền h\x00e0ng";
            this.Label5.TextAlign = ContentAlignment.TopRight;
            this.Panel4.Controls.Add(this.CmdDelRow);
            this.Panel4.Controls.Add(this.CmdAddRow);
            this.Panel4.Controls.Add(this.Panel5);
            this.Panel4.Dock = DockStyle.Bottom;
            point = new Point(0, 0x218);
            this.Panel4.Location = point;
            this.Panel4.Name = "Panel4";
            size = new Size(0x336, 0x48);
            this.Panel4.Size = size;
            this.Panel4.TabIndex = 0x30;
            this.CmdDelRow.Image = (Image) manager.GetObject("CmdDelRow.Image");
            this.CmdDelRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(100, 4);
            this.CmdDelRow.Location = point;
            this.CmdDelRow.Name = "CmdDelRow";
            size = new Size(0x59, 0x18);
            this.CmdDelRow.Size = size;
            this.CmdDelRow.TabIndex = 0x2e;
            this.CmdDelRow.Text = "&2.X\x00f3a d\x00f2ng";
            this.CmdDelRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdDelRow.UseVisualStyleBackColor = true;
            this.CmdAddRow.Image = (Image) manager.GetObject("CmdAddRow.Image");
            this.CmdAddRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(3, 4);
            this.CmdAddRow.Location = point;
            this.CmdAddRow.Name = "CmdAddRow";
            size = new Size(0x5c, 0x18);
            this.CmdAddRow.Size = size;
            this.CmdAddRow.TabIndex = 0x2d;
            this.CmdAddRow.Text = "&1.Th\x00eam d\x00f2ng";
            this.CmdAddRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdAddRow.UseVisualStyleBackColor = true;
            this.ToolStrip1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgbluenoborder;
            this.ToolStrip1.Items.AddRange(new ToolStripItem[] { this.CmdAdd, this.CmdEdit, this.ToolStripSeparator2, this.CmdSave, this.CmdUnsave, this.ToolStripSeparator1, this.CmdFind, this.CmdPrint, this.ToolStripButton1, this.CmdDel, this.ToolStripSeparator3, this.CmdExit, this.CmdHelp, this.CmdDieuKhoanMacDinh });
            point = new Point(0, 0);
            this.ToolStrip1.Location = point;
            this.ToolStrip1.Name = "ToolStrip1";
            size = new Size(0x336, 0x19);
            this.ToolStrip1.Size = size;
            this.ToolStrip1.TabIndex = 0x2d;
            this.ToolStrip1.Text = "ToolStrip1";
            this.CmdAdd.Image = (Image) manager.GetObject("CmdAdd.Image");
            this.CmdAdd.ImageTransparentColor = Color.White;
            this.CmdAdd.Name = "CmdAdd";
            size = new Size(0x49, 0x16);
            this.CmdAdd.Size = size;
            this.CmdAdd.Text = "&Th\x00eam mới";
            this.CmdAdd.ToolTipText = "F8 Th\x00eam mới bảng b\x00e1o gi\x00e1";
            this.CmdEdit.Image = (Image) manager.GetObject("CmdEdit.Image");
            this.CmdEdit.ImageTransparentColor = Color.White;
            this.CmdEdit.Name = "CmdEdit";
            size = new Size(0x2e, 0x16);
            this.CmdEdit.Size = size;
            this.CmdEdit.Text = "&Sửa";
            this.CmdEdit.ToolTipText = "F2 Chỉnh sửa bảng b\x00e1o gi\x00e1";
            this.ToolStripSeparator2.Name = "ToolStripSeparator2";
            size = new Size(6, 0x19);
            this.ToolStripSeparator2.Size = size;
            this.CmdSave.Image = (Image) manager.GetObject("CmdSave.Image");
            this.CmdSave.ImageTransparentColor = Color.WhiteSmoke;
            this.CmdSave.Name = "CmdSave";
            size = new Size(0x2d, 0x16);
            this.CmdSave.Size = size;
            this.CmdSave.Text = "&Lưu";
            this.CmdSave.ToolTipText = "F10 Lưu th\x00f4ng tin thay đổi";
            this.CmdUnsave.Image = (Image) manager.GetObject("CmdUnsave.Image");
            this.CmdUnsave.ImageTransparentColor = Color.White;
            this.CmdUnsave.Name = "CmdUnsave";
            size = new Size(0x37, 0x16);
            this.CmdUnsave.Size = size;
            this.CmdUnsave.Text = "&K.Lưu";
            this.CmdUnsave.ToolTipText = "F11 Kh\x00f4ng lưu th\x00f4ng tin thay đổi";
            this.ToolStripSeparator1.Name = "ToolStripSeparator1";
            size = new Size(6, 0x19);
            this.ToolStripSeparator1.Size = size;
            this.CmdFind.Image = (Image) manager.GetObject("CmdFind.Image");
            this.CmdFind.ImageTransparentColor = Color.White;
            this.CmdFind.Name = "CmdFind";
            size = new Size(0x45, 0x16);
            this.CmdFind.Size = size;
            this.CmdFind.Text = "T\x00ecm kiếm";
            this.CmdFind.ToolTipText = "F3 T\x00ecm kiếm bảng b\x00e1o gi\x00e1";
            this.CmdPrint.Image = (Image) manager.GetObject("CmdPrint.Image");
            this.CmdPrint.ImageTransparentColor = Color.White;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x24, 0x16);
            this.CmdPrint.Size = size;
            this.CmdPrint.Text = "&In";
            this.CmdPrint.ToolTipText = "F12 In bảng b\x00e1o gi\x00e1";
            this.ToolStripButton1.Name = "ToolStripButton1";
            size = new Size(6, 0x19);
            this.ToolStripButton1.Size = size;
            this.CmdDel.Image = (Image) manager.GetObject("CmdDel.Image");
            this.CmdDel.ImageTransparentColor = Color.White;
            this.CmdDel.Name = "CmdDel";
            size = new Size(0x2e, 0x16);
            this.CmdDel.Size = size;
            this.CmdDel.Text = "&X\x00f3a";
            this.CmdDel.ToolTipText = "F9 X\x00f3a bảng b\x00e1o gi\x00e1";
            this.ToolStripSeparator3.Name = "ToolStripSeparator3";
            size = new Size(6, 0x19);
            this.ToolStripSeparator3.Size = size;
            this.CmdExit.Alignment = ToolStripItemAlignment.Right;
            this.CmdExit.Image = (Image) manager.GetObject("CmdExit.Image");
            this.CmdExit.ImageTransparentColor = Color.White;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x37, 0x16);
            this.CmdExit.Size = size;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.CmdHelp.Alignment = ToolStripItemAlignment.Right;
            this.CmdHelp.Image = (Image) manager.GetObject("CmdHelp.Image");
            this.CmdHelp.ImageTransparentColor = Color.Magenta;
            this.CmdHelp.Name = "CmdHelp";
            size = new Size(0x31, 0x16);
            this.CmdHelp.Size = size;
            this.CmdHelp.Text = "&Help";
            this.CmdDieuKhoanMacDinh.Image = (Image) manager.GetObject("CmdDieuKhoanMacDinh.Image");
            this.CmdDieuKhoanMacDinh.ImageTransparentColor = Color.Magenta;
            this.CmdDieuKhoanMacDinh.Name = "CmdDieuKhoanMacDinh";
            size = new Size(0x81, 0x16);
            this.CmdDieuKhoanMacDinh.Size = size;
            this.CmdDieuKhoanMacDinh.Text = "Điều khoản mặc định";
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x336, 0x260);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.TabDetails);
            this.Controls.Add(this.TabControl1);
            this.Controls.Add(this.Panel4);
            this.Controls.Add(this.ToolStrip1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_HopDongMuaBan";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BH-0010";
            this.Text = "HOP DONG MUA BAN";
            ((ISupportInitialize) this.TxtTienThue).EndInit();
            ((ISupportInitialize) this.TxtTongCong).EndInit();
            ((ISupportInitialize) this.TxtSoTien).EndInit();
            this.TabDetails.ResumeLayout(false);
            this.TabPage4.ResumeLayout(false);
            this.VSlist.EndInit();
            this.TabPage2.ResumeLayout(false);
            this.VSListDieuKhoan.EndInit();
            this.TabPage1.ResumeLayout(false);
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            ((ISupportInitialize) this.txtTyGia).EndInit();
            this.GroupBox2.ResumeLayout(false);
            this.GroupBox2.PerformLayout();
            this.GroupBox1.ResumeLayout(false);
            this.GroupBox1.PerformLayout();
            this.TabControl1.ResumeLayout(false);
            this.Panel5.ResumeLayout(false);
            this.Panel5.PerformLayout();
            this.Panel4.ResumeLayout(false);
            this.ToolStrip1.ResumeLayout(false);
            this.ToolStrip1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        public void InsertBaoGia(string strKhoa)
        {
            ClsBaoGia gia = new ClsBaoGia();
            gia.Load(strKhoa);
            this.TxtSoBaoGia.Text = gia.SoChungTu;
            this.TxtSoBaoGia.Tag = gia.Khoa;
            this.TxtNgayDathang.Text = LVYModule.Char2Date(gia.NgayChungTu);
            this.AdvKhachHang.Value = gia.KhoaKhachHang;
            DataTable details = gia.GetDetails(strKhoa);
            if (details != null)
            {
                int num2 = details.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                    vSlist.AddItem("");
                    vSlist[vSlist.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(details.Rows[i]["Khoa"]);
                    vSlist[vSlist.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(details.Rows[i]["Loai"]);
                    vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TenLoai"]);
                    vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaHangHoa"]);
                    vSlist[vSlist.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(details.Rows[i]["MaHang"]);
                    vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TenHang"]);
                    vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaQG"]);
                    vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(details.Rows[i]["XuatXu"]);
                    vSlist[vSlist.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaHangSanXuat"]);
                    vSlist[vSlist.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(details.Rows[i]["HangSanXuat"]);
                    vSlist[vSlist.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(details.Rows[i]["ThoiGianBaoHanh"]);
                    vSlist[vSlist.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaDVT"]);
                    vSlist[vSlist.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(details.Rows[i]["DVT"]);
                    vSlist[vSlist.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(details.Rows[i]["QuyCach"]);
                    vSlist[vSlist.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(details.Rows[i]["SoLuong"]);
                    vSlist[vSlist.Rows.Count - 1, 15] = RuntimeHelpers.GetObjectValue(details.Rows[i]["DonGia"]);
                    vSlist[vSlist.Rows.Count - 1, 0x10] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TienHang"]);
                    vSlist[vSlist.Rows.Count - 1, 0x11] = RuntimeHelpers.GetObjectValue(details.Rows[i]["ThueSuat"]);
                    vSlist[vSlist.Rows.Count - 1, 0x12] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TienThue"]);
                    vSlist[vSlist.Rows.Count - 1, 0x13] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaThietBi"]);
                    vSlist = null;
                }
                this.TinhTong();
            }
        }

        public void LoadPhuTung(int nRow, string pKhoaThietBi)
        {
            clsDMHangHoa hoa = new clsDMHangHoa();
            clsGiaBan ban = new clsGiaBan();
            DataTable phuTung = hoa.GetPhuTung(pKhoaThietBi);
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            int num5 = phuTung.Rows.Count - 1;
            for (int i = 0; i <= num5; i++)
            {
                vSlist.AddItem("");
                vSlist[vSlist.Rows.Count - 1, 1] = "PT";
                vSlist[vSlist.Rows.Count - 1, 2] = modGeneral.Tranlated("Phụ t\x00f9ng", "");
                vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(phuTung.Rows[i]["KhoaPhuTung"]);
                vSlist[vSlist.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(phuTung.Rows[i]["MaPhuTung"]);
                vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(phuTung.Rows[i]["TenPhuTung"]);
                DataTable hangHoa = hoa.GetHangHoa(Conversions.ToString(vSlist[vSlist.Rows.Count - 1, 3]));
                vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["KhoaQuocGia"]);
                vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["XuatXu"]);
                vSlist[vSlist.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["KhoaHangSanXuat"]);
                vSlist[vSlist.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["HangSanXuat"]);
                vSlist[vSlist.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["ThoiGianBaoHanh"]);
                vSlist[vSlist.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["KhoaDonViTinh"]);
                vSlist[vSlist.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["DonViTinh"]);
                vSlist[vSlist.Rows.Count - 1, 13] = 1;
                vSlist[vSlist.Rows.Count - 1, 14] = 1;
                vSlist[vSlist.Rows.Count - 1, 0x11] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["TyLeThue"]);
                double giaBan = ban.GetGiaBan(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[vSlist.Rows.Count - 1, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), Conversions.ToString(this.CboLoaiGia.SelectedValue));
                int num4 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[vSlist.Rows.Count - 1, 0x11]), 0, modGeneral.TypeOfValue.Nothing));
                if (modGeneral.H_GIABANBAOGOMTHUE)
                {
                    double num3 = Math.Round((double) (giaBan / ((double) (100 + num4)))) * num4;
                    vSlist[vSlist.Rows.Count - 1, 0x12] = num3;
                    giaBan -= num3;
                }
                else
                {
                    vSlist[vSlist.Rows.Count - 1, 0x12] = Math.Round((double) ((giaBan * num4) / 100.0));
                }
                vSlist[vSlist.Rows.Count - 1, 15] = giaBan;
                vSlist[vSlist.Rows.Count - 1, 0x10] = giaBan;
            }
            vSlist = null;
        }

        private void mnInTiengAnh_Click(object sender, EventArgs e)
        {
            ReportModule.PrintBaoGia(this.cFrmKhoa, "ANH", 0);
        }

        private void mnInTiengViet_Click(object sender, EventArgs e)
        {
            ReportModule.PrintBaoGia(this.cFrmKhoa, "VIET", 0);
        }

        public bool SaveDetailsTemp()
        {
            int num2 = this.VSlist.Rows.Count - 1;
            for (int i = 1; i <= num2; i++)
            {
                clsHopDongMuaBanChiTiet objHDMBCT = this.objHDMBCT;
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    this.VSlist[i, 0] = modGeneral.CreatKey("BH_BaoGiaChiTiet", 15, "");
                }
                string str = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                objHDMBCT.Khoa = Conversions.ToString(this.VSlist[i, 0]);
                objHDMBCT.KhoaHopDongMuaBan = this.cFrmKhoa;
                objHDMBCT.Loai = Conversions.ToString(this.VSlist[i, 1]);
                objHDMBCT.KhoaHangHoa = Conversions.ToString(this.VSlist[i, 3]);
                objHDMBCT.KhoaQuocGia = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 6]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                objHDMBCT.KhoaHangSanXuat = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 8]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                objHDMBCT.ThoiGianBaoHanh = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 10]), 0, modGeneral.TypeOfValue.Nothing));
                objHDMBCT.KhoaDonViTinh = Conversions.ToString(this.VSlist[i, 11]);
                objHDMBCT.QuyCach = Conversions.ToDouble(this.VSlist[i, 13]);
                objHDMBCT.SoLuong = Conversions.ToDouble(this.VSlist[i, 14]);
                objHDMBCT.DonGia = Conversions.ToDouble(this.VSlist[i, 15]);
                objHDMBCT.TienHang = Conversions.ToDouble(this.VSlist[i, 0x10]);
                objHDMBCT.TyLeThue = Conversions.ToInteger(this.VSlist[i, 0x11]);
                objHDMBCT.TienThue = Conversions.ToDouble(this.VSlist[i, 0x12]);
                switch (str)
                {
                    case "TB":
                        this.VSlist[i, 0x13] = RuntimeHelpers.GetObjectValue(this.VSlist[i, 0]);
                        break;

                    case "":
                        this.VSlist[i, 0x13] = RuntimeHelpers.GetObjectValue(this.VSlist[i, 0]);
                        break;

                    case "PT":
                        if (i == 1)
                        {
                            this.VSlist[i, 0x13] = RuntimeHelpers.GetObjectValue(this.VSlist[i, 0]);
                        }
                        else if ((LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i - 1, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "TB") | (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i - 1, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == ""))
                        {
                            this.VSlist[i, 0x13] = RuntimeHelpers.GetObjectValue(this.VSlist[i - 1, 0x13]);
                        }
                        else if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i - 1, 0x13]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i - 1, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim())
                        {
                            this.VSlist[i, 0x13] = RuntimeHelpers.GetObjectValue(this.VSlist[i - 1, 0x13]);
                        }
                        else
                        {
                            this.VSlist[i, 0x13] = RuntimeHelpers.GetObjectValue(this.VSlist[i, 0]);
                        }
                        break;
                }
                objHDMBCT.KhoaThietBi = Conversions.ToString(this.VSlist[i, 0x13]);
                if (!objHDMBCT.Save())
                {
                    return false;
                }
                objHDMBCT = null;
            }
            return true;
        }

        public void SetLanguage()
        {
            this.CmdAdd.Text = modGeneral.Tranlated(this.CmdAdd.Text, "");
            this.CmdEdit.Text = modGeneral.Tranlated(this.CmdEdit.Text, "");
            this.CmdDel.Text = modGeneral.Tranlated(this.CmdDel.Text, "");
            this.CmdSave.Text = modGeneral.Tranlated(this.CmdSave.Text, "");
            this.CmdUnsave.Text = modGeneral.Tranlated(this.CmdUnsave.Text, "");
            this.CmdPrint.Text = modGeneral.Tranlated(this.CmdPrint.Text, "");
            this.CmdHelp.Text = modGeneral.Tranlated(this.CmdHelp.Text, "");
            this.CmdExit.Text = modGeneral.Tranlated(this.CmdExit.Text, "");
            this.TabControl1.TabPages[0].Text = modGeneral.Tranlated(this.TabControl1.TabPages[0].Text, "");
        }

        public void ShowData(string pKhoa)
        {
            clsHopDongMuaBan objHDMB = this.objHDMB;
            objHDMB.Load(pKhoa);
            this.TxtSoBaoGia.Text = objHDMB.SoBaoGia;
            this.TxtSoBaoGia.Tag = objHDMB.KhoaBaoGia;
            this.TxtNgayDathang.Text = LVYModule.Char2Date(objHDMB.NgayBaoGia);
            this.cFrmKhoa = objHDMB.Khoa;
            this.TxtSoChungTu.Text = objHDMB.SoChungTu.Trim();
            this.AdvKhachHang.Value = objHDMB.KhoaDoiTuong.Trim();
            this.CboLienHe.Text = objHDMB.DaiDien.Trim();
            this.TxtChucVu.Text = objHDMB.ChucVu.Trim();
            this.CboLoaiGia.SelectedValue = objHDMB.KhoaLoaiGia;
            this.CboLoaiTien.SelectedValue = objHDMB.LoaiTien.Trim();
            this.AdvNhanVien.Value = objHDMB.KhoaNhanVien;
            this.TxtChucVuBan.Text = objHDMB.ChucVuNhanVien;
            this.txtTyGia.Value = objHDMB.Tygia;
            this.TxtNgayChungTu.Text = LVYModule.Char2Date(objHDMB.NgayChungTu);
            this.TxtHanGiaoHang.Text = LVYModule.Char2Date(objHDMB.NgayHieuLuc);
            this.TxtDienThoai.Text = objHDMB.DienThoai.Trim();
            this.TxtFax.Text = objHDMB.Fax.Trim();
            this.TxtSoTien.Value = objHDMB.TongTienHang;
            this.TxtTienThue.Value = objHDMB.TongTienThue;
            this.TxtTongCong.Value = objHDMB.TongTienHang + objHDMB.TongTienThue;
            this.TxtMaSoThue.Text = objHDMB.MaSoThue.Trim();
            this.TxtDiaChi.Text = objHDMB.DiaChi;
            if (modGeneral.H_LANGUAGE.Trim().ToUpper() == "VIET")
            {
                this.TxtCongTy.Text = modGeneral.H_COMPANYNAMEVIET;
                this.TxtDiaChiBan.Text = modGeneral.H_ADDRESSVIET;
            }
            else
            {
                this.TxtCongTy.Text = modGeneral.H_COMPANYNAMEANH;
                this.TxtDiaChiBan.Text = modGeneral.H_ADDRESSANH;
            }
            this.TxtMaSoThueBan.Text = modGeneral.H_TAXCODE;
            this.TxtDienThoaiBan.Text = modGeneral.H_TELEPHONE;
            this.TxtFaxBan.Text = modGeneral.H_FAX;
            objHDMB = null;
            DataTable details = this.objHDMB.GetDetails(this.cFrmKhoa);
            if (details != null)
            {
                int num2 = details.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                    vSlist.AddItem("");
                    vSlist[vSlist.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(details.Rows[i]["Khoa"]);
                    vSlist[vSlist.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(details.Rows[i]["Loai"]);
                    vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TenLoai"]);
                    vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaHangHoa"]);
                    vSlist[vSlist.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(details.Rows[i]["MaHang"]);
                    vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TenHang"]);
                    vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaQG"]);
                    vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(details.Rows[i]["XuatXu"]);
                    vSlist[vSlist.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaHangSanXuat"]);
                    vSlist[vSlist.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(details.Rows[i]["HangSanXuat"]);
                    vSlist[vSlist.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(details.Rows[i]["ThoiGianBaoHanh"]);
                    vSlist[vSlist.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaDVT"]);
                    vSlist[vSlist.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(details.Rows[i]["DVT"]);
                    vSlist[vSlist.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(details.Rows[i]["QuyCach"]);
                    vSlist[vSlist.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(details.Rows[i]["SoLuong"]);
                    vSlist[vSlist.Rows.Count - 1, 15] = RuntimeHelpers.GetObjectValue(details.Rows[i]["DonGia"]);
                    vSlist[vSlist.Rows.Count - 1, 0x10] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TienHang"]);
                    vSlist[vSlist.Rows.Count - 1, 0x11] = RuntimeHelpers.GetObjectValue(details.Rows[i]["ThueSuat"]);
                    vSlist[vSlist.Rows.Count - 1, 0x12] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TienThue"]);
                    vSlist[vSlist.Rows.Count - 1, 0x13] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaThietBi"]);
                    vSlist = null;
                }
                this.GetDieuKhoan(pKhoa);
            }
        }

        public void TinhThue(int nRow)
        {
            double num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 0x10]), 0, modGeneral.TypeOfValue.Nothing));
            int num2 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 0x11]), 0, modGeneral.TypeOfValue.Nothing));
            this.VSlist[nRow, 0x12] = Math.Round((double) ((num * num2) / 100.0), 0);
        }

        public void TinhTienHang(int nRow)
        {
            double num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 14]), 0, modGeneral.TypeOfValue.Nothing));
            double num = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 15]), 0, modGeneral.TypeOfValue.Nothing));
            this.VSlist[nRow, 0x10] = num2 * num;
        }

        public void TinhTong()
        {
            this.TxtSoTien.Value = LVYModule.SumColGrid(this.VSlist, 0x10);
            this.TxtTienThue.Value = LVYModule.SumColGrid(this.VSlist, 0x12);
            this.TxtTongCong.Value = Microsoft.VisualBasic.CompilerServices.Operators.AddObject(this.TxtSoTien.Value, this.TxtTienThue.Value);
        }

        public object UpdateData()
        {
            object obj2;
            clsHopDongMuaBan objHDMB = this.objHDMB;
            objHDMB.Khoa = this.cFrmKhoa;
            objHDMB.SoChungTu = this.TxtSoChungTu.Text;
            objHDMB.KhoaBaoGia = Conversions.ToString(this.TxtSoBaoGia.Tag);
            objHDMB.SoBaoGia = this.TxtSoBaoGia.Text;
            objHDMB.NgayBaoGia = LVYModule.Date2Char(this.TxtNgayDathang.Text);
            objHDMB.KhoaDoiTuong = this.AdvKhachHang.Value;
            objHDMB.DaiDien = this.CboLienHe.Text;
            objHDMB.ChucVu = this.TxtChucVu.Text;
            objHDMB.KhoaLoaiGia = Conversions.ToString(this.CboLoaiGia.SelectedValue);
            objHDMB.LoaiTien = Conversions.ToString(this.CboLoaiTien.SelectedValue);
            objHDMB.KhoaNhanVien = this.AdvNhanVien.Value;
            objHDMB.NgayChungTu = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
            objHDMB.NgayHieuLuc = LVYModule.Date2Char(this.TxtHanGiaoHang.Text);
            objHDMB.DiaChi = this.TxtDiaChi.Text;
            objHDMB.MaSoThue = this.TxtMaSoThue.Text;
            objHDMB.DienThoai = this.TxtDienThoai.Text;
            objHDMB.Fax = this.TxtFax.Text;
            objHDMB.TongTienHang = Conversions.ToDouble(this.TxtSoTien.Value);
            objHDMB.TongTienThue = Conversions.ToDouble(this.TxtTienThue.Value);
            objHDMB.Tygia = Conversions.ToDouble(this.txtTyGia.Value);
            objHDMB.ChucVuNhanVien = this.TxtChucVuBan.Text.Trim();
            if (objHDMB.KhoaNhanVienTao.Trim() == "")
            {
                objHDMB.KhoaNhanVienTao = modGeneral.H_USERID;
            }
            if (objHDMB.NgayTao.Trim() == "")
            {
                objHDMB.NgayTao = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            }
            objHDMB.KhoaNhanVienSua = modGeneral.H_USERID;
            objHDMB.NgaySua = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            return objHDMB.Save();
            objHDMB = null;
            return obj2;
        }

        private void VSlist_AfterEdit(object sender, RowColEventArgs e)
        {
            switch (e.Col)
            {
                case 14:
                case 15:
                    this.TinhTienHang(e.Row);
                    this.TinhThue(e.Row);
                    this.TinhTong();
                    break;

                case 0x11:
                    this.TinhThue(e.Row);
                    this.TinhTong();
                    break;
            }
        }

        private void VSlist_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (!this.mEnabledControl)
            {
                e.Cancel = true;
            }
            else if ((e.Col == 5) | (e.Col == 13))
            {
                e.Cancel = true;
            }
        }

        private void VSlist_CellButtonClick(object sender, RowColEventArgs e)
        {
            string[] strArray;
            string expression = "";
            switch (e.Col)
            {
                case 2:
                {
                    DataTable pDataSource = modGeneral.H_DUNGCHUNG.ShowList("0000000004");
                    strArray = LVYModule.ShowMultiDropDownBySource(this.VSlist, e.Row, e.Col, pDataSource, 10, 0, LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 1]), "", modGeneral.TypeOfValue.Nothing).ToString(), "");
                    if (Information.UBound(strArray, 1) > 0)
                    {
                        this.VSlist[e.Row, 1] = strArray[0];
                        this.VSlist[e.Row, 2] = strArray[1];
                    }
                    this.VSlist.Select(e.Row, 4);
                    break;
                }
                case 4:
                {
                    expression = SearchModule.SearchHangHoa("", "", "");
                    if (expression.Trim() != "")
                    {
                        strArray = Strings.Split(expression, "|", -1, CompareMethod.Binary);
                        this.VSlist[e.Row, 3] = strArray[0];
                        this.VSlist[e.Row, 4] = strArray[1];
                        this.VSlist[e.Row, 5] = strArray[2];
                        DataTable hangHoa = new clsDMHangHoa().GetHangHoa(strArray[0].ToString());
                        this.VSlist[e.Row, 6] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["KhoaQuocGia"]);
                        this.VSlist[e.Row, 7] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["XuatXu"]);
                        this.VSlist[e.Row, 8] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["KhoaHangSanXuat"]);
                        this.VSlist[e.Row, 9] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["HangSanXuat"]);
                        this.VSlist[e.Row, 10] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["ThoiGianBaoHanh"]);
                        this.VSlist[e.Row, 11] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["KhoaDonViTinh"]);
                        this.VSlist[e.Row, 12] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["DonViTinh"]);
                        this.VSlist[e.Row, 13] = 1;
                        this.VSlist[e.Row, 14] = 1;
                        this.VSlist[e.Row, 0x11] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["TyLeThue"]);
                    }
                    double giaBan = new clsGiaBan().GetGiaBan(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), Conversions.ToString(this.CboLoaiGia.SelectedValue));
                    int num3 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 0x11]), 0, modGeneral.TypeOfValue.Nothing));
                    if (modGeneral.H_GIABANBAOGOMTHUE)
                    {
                        double num2 = Math.Round((double) (giaBan / ((double) (100 + num3)))) * num3;
                        this.VSlist[e.Row, 0x12] = num2;
                        giaBan -= num2;
                    }
                    else
                    {
                        this.VSlist[e.Row, 0x12] = Math.Round((double) ((giaBan * num3) / 100.0));
                    }
                    this.VSlist[e.Row, 15] = giaBan;
                    this.VSlist[e.Row, 0x10] = giaBan;
                    this.VSlist.Select(e.Row, 7);
                    if (e.Row > 1)
                    {
                        this.VSlist[e.Row, 6] = RuntimeHelpers.GetObjectValue(this.VSlist[e.Row - 1, 6]);
                        this.VSlist[e.Row, 7] = RuntimeHelpers.GetObjectValue(this.VSlist[e.Row - 1, 7]);
                        this.VSlist.Select(e.Row, 12);
                    }
                    this.LoadPhuTung(e.Row, Conversions.ToString(this.VSlist[e.Row, 3]));
                    this.TinhTong();
                    break;
                }
                case 7:
                    expression = SearchModule.SearchQuocGia("");
                    if (expression.Trim() != "")
                    {
                        strArray = Strings.Split(expression, "|", -1, CompareMethod.Binary);
                        this.VSlist[e.Row, 6] = strArray[0];
                        this.VSlist[e.Row, 7] = strArray[2];
                    }
                    this.VSlist.Select(e.Row, 12);
                    break;

                case 9:
                    expression = SearchModule.SearchHangSanXuat("");
                    if (expression.Trim() != "")
                    {
                        strArray = Strings.Split(expression, "|", -1, CompareMethod.Binary);
                        this.VSlist[e.Row, 8] = strArray[0];
                        this.VSlist[e.Row, 9] = strArray[2];
                    }
                    this.VSlist.Select(e.Row, 12);
                    break;

                case 12:
                    strArray = SearchModule.SearchDVT(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), this.VSlist, e.Row, e.Col, LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 13]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
                    if (strArray != null)
                    {
                        if (Information.UBound(strArray, 1) >= 2)
                        {
                            this.VSlist[e.Row, 11] = strArray[0];
                            this.VSlist[e.Row, 12] = strArray[1];
                            this.VSlist[e.Row, 13] = strArray[2];
                        }
                        this.VSlist.Select(e.Row, 15);
                        break;
                    }
                    break;
            }
        }

        private void VSListDieuKhoan_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (!this.mEnabledControl)
            {
                e.Cancel = true;
            }
        }

        internal virtual ADVObjects AdvKhachHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvKhachHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVObjects.ValueChangedEventHandler handler = new ADVObjects.ValueChangedEventHandler(this.AdvNhaCungCap_ValueChanged);
                if (this._AdvKhachHang != null)
                {
                    this._AdvKhachHang.ValueChanged -= handler;
                }
                this._AdvKhachHang = value;
                if (this._AdvKhachHang != null)
                {
                    this._AdvKhachHang.ValueChanged += handler;
                }
            }
        }

        internal virtual ADVObjects AdvNhanVien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvNhanVien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVObjects.ValueChangedEventHandler handler = new ADVObjects.ValueChangedEventHandler(this.AdvNhanVien_ValueChanged);
                if (this._AdvNhanVien != null)
                {
                    this._AdvNhanVien.ValueChanged -= handler;
                }
                this._AdvNhanVien = value;
                if (this._AdvNhanVien != null)
                {
                    this._AdvNhanVien.ValueChanged += handler;
                }
            }
        }

        internal virtual ComboBox CboLienHe
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLienHe;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboLienHe = value;
            }
        }

        internal virtual ComboBox CboLoaiGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboLoaiGia = value;
            }
        }

        internal virtual ComboBox CboLoaiTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiTien_SelectedIndexChanged);
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged -= handler;
                }
                this._CboLoaiTien = value;
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual Button CmdAddRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAddRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAddRow_Click);
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click -= handler;
                }
                this._CmdAddRow = value;
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDel_Click);
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click -= handler;
                }
                this._CmdDel = value;
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click += handler;
                }
            }
        }

        internal virtual Button CmdDelRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDelRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDelRow_Click);
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click -= handler;
                }
                this._CmdDelRow = value;
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdDieuKhoanMacDinh
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDieuKhoanMacDinh;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdDieuKhoanMacDinh = value;
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdEdit_Click);
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click -= handler;
                }
                this._CmdEdit = value;
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdFind
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdFind;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdFind_Click);
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click -= handler;
                }
                this._CmdFind = value;
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdHelp
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdHelp;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdHelp = value;
            }
        }

        internal virtual ToolStripButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdPrint = value;
            }
        }

        internal virtual ToolStripButton CmdSave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdSave_Click);
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click -= handler;
                }
                this._CmdSave = value;
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click += handler;
                }
            }
        }

        internal virtual Button cmdTimDonHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._cmdTimDonHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.cmdTimDonHang_Click);
                if (this._cmdTimDonHang != null)
                {
                    this._cmdTimDonHang.Click -= handler;
                }
                this._cmdTimDonHang = value;
                if (this._cmdTimDonHang != null)
                {
                    this._cmdTimDonHang.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdUnsave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdUnsave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdUnsave_Click);
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click -= handler;
                }
                this._CmdUnsave = value;
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click += handler;
                }
            }
        }

        public bool EnabledControl
        {
            get
            {
                return this.mEnabledControl;
            }
            set
            {
                this.mEnabledControl = value;
                this.CmdAdd.Enabled = !value & this.mAllowAdd;
                this.CmdEdit.Enabled = !value & this.mAllowEdit;
                this.CmdSave.Enabled = value;
                this.CmdUnsave.Enabled = value;
                this.CmdDel.Enabled = !value & this.mAllowDel;
                this.CmdFind.Enabled = !value;
                this.CmdExit.Enabled = !value;
                this.CmdAddRow.Enabled = value;
                this.CmdDelRow.Enabled = value;
                this.CmdPrint.Enabled = !value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.TxtNgayChungTu.Enabled = value;
                this.CboLoaiTien.Enabled = value;
                this.txtTyGia.ReadOnly = !value;
                this.TxtChucVu.ReadOnly = !value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.AdvKhachHang.ReadOnly = !value;
                this.CboLienHe.Enabled = value;
                this.TxtChucVu.ReadOnly = !value;
                this.TxtDienThoai.ReadOnly = !value;
                this.TxtFax.ReadOnly = !value;
                this.TxtHanGiaoHang.Enabled = value;
                this.AdvNhanVien.ReadOnly = !value;
                this.cmdTimDonHang.Enabled = value;
                this.CboLoaiGia.Enabled = value;
                this.TxtDiaChi.ReadOnly = !value;
                this.TxtMaSoThue.ReadOnly = !value;
                this.TxtCongTy.ReadOnly = !value;
                this.TxtDiaChiBan.ReadOnly = !value;
                this.TxtMaSoThueBan.ReadOnly = !value;
                this.TxtDienThoaiBan.ReadOnly = !value;
                this.TxtFaxBan.ReadOnly = !value;
                this.TxtChucVuBan.ReadOnly = !value;
            }
        }

        internal virtual GroupBox GroupBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox1 = value;
            }
        }

        internal virtual GroupBox GroupBox2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox2 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label10
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label10;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label10 = value;
            }
        }

        internal virtual Label Label11
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label11;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label11 = value;
            }
        }

        internal virtual Label Label12
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label12;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label12 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label14
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label14;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label14 = value;
            }
        }

        internal virtual Label Label15
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label15;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label15 = value;
            }
        }

        internal virtual Label Label16
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label16;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label16 = value;
            }
        }

        internal virtual Label Label17
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label17;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label17 = value;
            }
        }

        internal virtual Label Label18
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label18;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label18 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label20
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label20;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label20 = value;
            }
        }

        internal virtual Label Label21
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label21;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label21 = value;
            }
        }

        internal virtual Label Label22
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label22;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label22 = value;
            }
        }

        internal virtual Label Label23
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label23;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label23 = value;
            }
        }

        internal virtual Label Label24
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label24;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label24 = value;
            }
        }

        internal virtual Label Label25
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label25;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label25 = value;
            }
        }

        internal virtual Label Label26
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label26;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label26 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Label Label8
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label8;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label8 = value;
            }
        }

        internal virtual Label Label9
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label9;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label9 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel Panel4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel4 = value;
            }
        }

        internal virtual Panel Panel5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel5 = value;
            }
        }

        internal virtual TabControl TabControl1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabControl1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabControl1 = value;
            }
        }

        internal virtual TabControl TabDetails
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabDetails;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabDetails = value;
            }
        }

        internal virtual TabPage TabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage1 = value;
            }
        }

        internal virtual TabPage TabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage2 = value;
            }
        }

        internal virtual TabPage TabPage4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage4 = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripButton1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator3 = value;
            }
        }

        internal virtual TextBox TxtChucVu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtChucVu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtChucVu = value;
            }
        }

        internal virtual TextBox TxtChucVuBan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtChucVuBan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtChucVuBan = value;
            }
        }

        internal virtual TextBox TxtCongTy
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtCongTy;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtCongTy = value;
            }
        }

        internal virtual TextBox TxtDiaChi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDiaChi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDiaChi = value;
            }
        }

        internal virtual TextBox TxtDiaChiBan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDiaChiBan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDiaChiBan = value;
            }
        }

        internal virtual TextBox TxtDienThoai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienThoai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDienThoai = value;
            }
        }

        internal virtual TextBox TxtDienThoaiBan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienThoaiBan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDienThoaiBan = value;
            }
        }

        internal virtual TextBox TxtFax
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtFax;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtFax = value;
            }
        }

        internal virtual TextBox TxtFaxBan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtFaxBan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtFaxBan = value;
            }
        }

        internal virtual DateTimePicker TxtHanGiaoHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtHanGiaoHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtHanGiaoHang = value;
            }
        }

        internal virtual TextBox TxtMaSoThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtMaSoThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtMaSoThue = value;
            }
        }

        internal virtual TextBox TxtMaSoThueBan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtMaSoThueBan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtMaSoThueBan = value;
            }
        }

        internal virtual DateTimePicker TxtNgayChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayChungTu = value;
            }
        }

        internal virtual DateTimePicker TxtNgayDathang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayDathang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayDathang = value;
            }
        }

        internal virtual TextBox TxtSoBaoGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoBaoGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoBaoGia = value;
            }
        }

        internal virtual TextBox TxtSoChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoChungTu = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTien = value;
            }
        }

        internal virtual C1NumericEdit TxtTienThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienThue = value;
            }
        }

        internal virtual C1NumericEdit TxtTongCong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongCong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongCong = value;
            }
        }

        internal virtual C1NumericEdit txtTyGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtTyGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._txtTyGia = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSlist_CellButtonClick);
                RowColEventHandler handler2 = new RowColEventHandler(this.VSlist_BeforeEdit);
                RowColEventHandler handler3 = new RowColEventHandler(this.VSlist_AfterEdit);
                if (this._VSlist != null)
                {
                    this._VSlist.CellButtonClick -= handler;
                    this._VSlist.BeforeEdit -= handler2;
                    this._VSlist.AfterEdit -= handler3;
                }
                this._VSlist = value;
                if (this._VSlist != null)
                {
                    this._VSlist.CellButtonClick += handler;
                    this._VSlist.BeforeEdit += handler2;
                    this._VSlist.AfterEdit += handler3;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSListDieuKhoan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSListDieuKhoan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSListDieuKhoan_BeforeEdit);
                if (this._VSListDieuKhoan != null)
                {
                    this._VSListDieuKhoan.BeforeEdit -= handler;
                }
                this._VSListDieuKhoan = value;
                if (this._VSListDieuKhoan != null)
                {
                    this._VSListDieuKhoan.BeforeEdit += handler;
                }
            }
        }
    }
}

